<?php 
session_start();
define("PATH",realpath(dirname(__FILE__))."/");
require_once PATH."libs/dibi/dibi.php";
require_once PATH."config.php";
require_once PATH."includes/func.php";
require_once PATH.'lang/'.$confdb['lang'].'_lang.php';
require_once PATH.'style/header.php';
require_once PATH.'style/menu.php';
if(@!$_GET['page'])
{
//index code
include PATH.'scripts/index_script.php';
} else {
switch($_GET['page'])
{
case "article": 
if(@$_GET['id']) 
{
 include PATH.'scripts/read_article.php';
}
else {echo $lang['article_id_not_in_url'];};
break;
case "user":
//user
echo "user";
break;
case "login";
include PATH.'scripts/login.php';
break;
case "logout";
include PATH.'scripts/logout.php';
break;
case "cat":
if(@$_GET['id']) 
{
 include PATH.'scripts/view_category.php';
}
else {echo $lang['category_id_not_in_url'];};
break;
case "activate":
	include "scripts/activate.php";
break;
case "register":
	include "scripts/register.php";
break;
default:
echo "404 not found";
break;
};
};
require_once PATH.'style/footer.php';
?>
